﻿namespace Uber.WebUI.Controllers
{
    using System.Web.Mvc;
    using Core.Model;
    using Core.Service;

    [HandleError]
    public class HomeController : Controller
    {
        private readonly IMailSender mailSender;

        public HomeController(IMailSender mailSender)
        {
            this.mailSender = mailSender;
        }

        public ActionResult Index(int? page)
        {
            return View();
        }
        
        public ActionResult About()
        {
            return View();
        }

        public ActionResult Send()
        {
            mailSender.SendEmailAsync("noreply@awesome.com", "vnexster@gmail.com", "hi async", "whatsup");
            mailSender.SendEmail("noreply@awesome.com", "vnexster@gmail.com", "hi", "whatsup");
            return RedirectToAction("Index");
        }

        public ActionResult Ref(long id)
        {
            Session[The.Ref] = id;
            return RedirectToAction("Index");
        }

        public ActionResult Do(int id)
        {
            return Content(id.ToString());
        }
    }
}


